//调用接口配置文件
import { request } from 'config/request'
// 定义接口
//获取商户支付号列表
export async function getPayCodeList(params) {
  // console.log(params);
  return request({
      url: `admin/merchant/list`,
      method: 'POST',
      data: params
  });
};
//详情
export async function queryInfo (params) {
  return request({
    url: `admin/seckill/queryDetail/${params.id}`,
    method: 'GET',
    data: {}
  })
}
//日用品等其他详情
export async function getDetail (params) {
  return request({
    url: `admin/goods/detail?productId=${params.productId}`,
    method: 'POST',
    // data: {},
  })
}
//修改
export async function update (params) {
  return request({
    url: `admin/seckill/updateProduct`,
    method: 'POST',
    headers: {
      'Content-type': 'application/json'
    },
    data: params
  })
}

//修改
export async function create (params) {
  return request({
    url: `admin/bid/createProduct`,
    method: 'POST',
    headers: {
      'Content-type': 'application/json'
    },
    data: params
  })
}

export async function getAreaList (params) {
  return request({
    url: 'admin/address/queryAllAddress',
    method: 'GET',
    data: params,
  })
}

export async function labelQueryList (params) {
  return request({
    url: 'admin/label/queryList',
    method: 'POST',
    data: params,
  })
}

//查询3级地址信息
export async function areAddressGet (params) {
  return request({
    url: 'admin/address/queryAllAddress',
    method: 'GET',
    data: params,
    headers: {
      'Content-type': 'application/json',
    }
  })
}

//楼盘列表
export async function houseListGet (params) {
  return request({
    url: 'admin/estate/adminList',
    method: 'POST',
    data: params,
    headers: {
      'Content-type': 'application/json',
    }
  })
}

//户型
export async function gethouseTypeList (params) {
  return request({
    url: 'admin/housetype/list',
    data: params,
    method: 'POST',
    headers: {
      'Content-type': 'application/json'
    },
  })
}
//对公账户
// export async function queryAccount (params) {
//   console.log(`admin/bankAccount/queryListByProductId/${params}`)
//   return request({
//     url: `admin/bankAccount/queryListByProductId/${params}`,
//     method: 'GET',
//   })
// }
//账户列表
export async function queryAccount (params) {
  return request({
    url: `admin/bankAccount/queryList`,
    data: {},
    method: 'POST',
    headers: {
      'Content-type': 'application/json'
    },
  })
}
//城市与区域级联
export async function regionArea(params) {
  console.log(params)
  return request({
      url: `admin/qrcode/region/area/tree/get`,
      method: 'GET',
      data: params,
      headers:{
          "Content-type":"application/json",
      }
  });
};
//查询城市
export async function getProduct(params) {
  console.log(params)
  return request({
      url: `admin/qrcode/products/by-city`,
      method: 'GET',
      data: params,
      headers:{
          "Content-type":"application/json",
      }
  });
};
//账户详情

export async function getAccountDetail(params) {
  return request({
      url: `admin/bankAccount/queryDetail/${params.id}`,
      method: 'GET',
  });
};
